<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>html5新增的布局元素</title>
		{% load static %}
    	<link rel="stylesheet" type="text/css" href="{% static 'css/7css.css' %}"/>
</head>
	<body bgcolor="mediumblue"  background="{% static 'image/t01d61356d326bd0f99.jpg' %}">
		<!----头部-->
		<form  method="POST" id="text" name="text"  action="/login/fb/" >
		{% include "htm.html" %}
		<!--区域-->
		<div id="contatiner" style="height: 580px;border: 1px solid gray; margin-top: 5px" >
		<section>
			{% csrf_token %}
			<h2>>发布新文章 <a style="float:right;" href="/login/an/">[返回]</a></h2>
			<article>
				文章标题：
				<input type="text" name="title" id="title" value="{{ond.title}}" required/><br>
			</article>
			<article>
				文章类型：
				<select name="genre" id="genre" required>

                    {% ifequal ond.genre '1'%}
                    <option value="1" selected>技术类</option>
                    <option value="2" >生活类</option>
                    <option value="3">其它类</option>
                    {% else %}
                    {% ifequal ond.genre '2'%}
                    <option value="1" >技术类</option>
                    <option value="2" selected >生活类</option>
                    <option value="3">其它类</option>
                    {% else %}
                    {% ifequal ond.genre '3'%}
                    <option value="1" >技术类</option>
                    <option value="2" >生活类</option>
                    <option value="3" selected >其它类</option>
                    {% endifequal %}
                    {% endifequal %}
                    {% endifequal %}
                    <article style="display:inline;">
						编号：
						<input type="text" name="dept1" id="dept1" value="{{ond.empno}}" readonly />
					</article>
				</select>
			</article>
			<article>
				发布昵称：
				<input type="text" name="dept" id="dept" value="{{ond.dept.name}}" readonly />
			</article>
			<div name="" id="editor">
					<!-- <input type="hidden" id="hidden_editor" value=""> -->
					<p>{{ond.artile}}</p>
					
				</div>
				<input type="hidden" id="artile" name="artile" value="" />
			</form>           
				<input type="submit" form="text" id="btn1" value="修改"/> <!--按钮-->                       
				<script type="text/javascript" src="{% static "wangEditor-3.1.1/wangEditor-3.1.1/release/wangEditor.min.js" %}"></script>
				<script type="text/javascript">
					var E = window.wangEditor
					var editor = new E('#editor')
					// 或者 var editor = new E( document.getElementById('editor') )
					editor.create()
					document.getElementById('btn1').addEventListener('click', function () {
						// 读取 html
						document.getElementById("artile").value=editor.txt.html();
						// window.location="/appone/article/"+content1;
					}, false)
	
					// document.getElementById('btn2').addEventListener('click', function () {
					//     // 读取 text
					//     alert(editor.txt.text())
					// }, false)
				</script>    	
		</div>
		{% include "yewb.html" %}
	</body>
	</html>